home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / tex / rail.zip / RAIL.H < prev    next >
C/C++ Source or Header  |  1992-01-15  |  2KB  |  93 lines

  1. /*
  2.  * rail.h - global definitions for rail program
  3.  *
  4.  */
  5.  
  6. #define    UNKNOWN    '?'        /* unknown */
  7. #define    TOKEN    'o'        /* terminal or nonterminal */
  8. #define    TERM    't'        /* terminal */
  9. #define    NTERM    'n'        /* nonterminal */
  10.  
  11. typedef struct id {
  12.     char *name;        /* identifier */
  13.     struct id *next;    /* link to next entry */
  14.     int kind;        /* UNKNOWN, TOKEN, TERM, NTERM */
  15. } IDTYPE;
  16.  
  17. #define    EMPTY    'e'
  18. #define    CAT    ';'
  19. #define    BAR    '|'
  20. #define    PLUS    '+'
  21. #define    ANNOTE    'a'
  22. #define    IDENT    'i'
  23. #define    STRNG    's'
  24. #define    CR    'c'
  25.  
  26. #define    MAXLIST    50
  27.  
  28. typedef struct body {
  29.     int kind;            /* kind */
  30.     struct body *list[MAXLIST];    /* sub-bodies */
  31.     int nlist;            /* number of bodies */
  32.     int entry,exit;            /* entry, exit */
  33.     int ystart;            /* starting y coordinate */
  34.     int ynext;            /* next y coordinate */
  35.     int done;            /* done flag */
  36.     IDTYPE *id;            /* identifier */
  37.     char *text;            /* text */
  38.     char *annot;            /* annotation */
  39. } BODYTYPE;
  40.  
  41. #define    NULLBODY    ((BODYTYPE *)NULL)
  42.  
  43. typedef struct rule {
  44.     IDTYPE *id;
  45.     BODYTYPE *body;
  46.     struct rule *next;
  47. } RULETYPE;
  48.  
  49. typedef union {
  50.     IDTYPE *id;    /* identifier */
  51.     int num;    /* number */
  52.     char *text;    /* text */
  53.     BODYTYPE *body;    /* body */
  54.     RULETYPE *rule;    /* rule */
  55. } YYSTYPE;
  56.  
  57. extern char *myname;
  58.  
  59. extern char *file;
  60. extern int line;
  61. extern int copy;
  62.  
  63. extern FILE *outf;
  64.  
  65. extern int altstar;
  66. extern int anonymous;
  67.  
  68. extern IDTYPE *errorid;
  69.  
  70. extern char *mcheck();
  71. extern char *malloc();
  72. extern char *strdup();
  73.  
  74. extern setopt();
  75.  
  76. extern BODYTYPE *newbody();
  77. extern freebody();
  78. extern int isemptybody();
  79. extern BODYTYPE *addbody();
  80. extern BODYTYPE *revbody();
  81.  
  82. extern RULETYPE *newrule();
  83. extern freerule();
  84. extern RULETYPE *addrule();
  85. extern outrule();
  86.  
  87. extern IDTYPE *lookup();
  88. extern delete();
  89.  
  90. extern undef();
  91. extern redef();
  92. extern error();
  93.